
import { ajax, toast } from 'nc-lightapp-front';
import { STATUS } from '../../../../common/constant';
import { AREA, URL, FIELDS } from '../../constance';
import refreshBtnClick from './refreshBtnClick';

export default function RedHandleClick(props, record, index) {
        let pk = record['pk_amortization'] && record['pk_amortization'].value;
        let ts = record['ts'] && record['ts'].value;
        let aciton = 'RedHandle';

        let data = [
            {
                pk:pk,
                ts:ts,
                action:aciton
            }
        ]

        ajax({
            url: URL.Voucher,
            data: data,
            success: (res) => {
                refreshBtnClick.call(this, props);
                toast({ content: '操作成功', color: STATUS.success });

            }
        })
        
}
